<template>
  <view>
    <u-navbar title="上传处方" back-icon-size="34" title-size="36" :border-bottom="false" :background="background" title-color="#222" back-icon-color="#222"></u-navbar>
    <view class="" style="margin: 28rpx; background: #fff; border-radius: 20rpx">
      <view class="" style="text-align: center; padding-top: 21rpx">
        <image
          :src="data.drugs_status == 1 ? 'https://wenzhen.fuerle168.com/static/load.png' : 'https://wenzhen.fuerle168.com/static//cheng.png'"
          mode=""
          style="width: 60rpx; height: 60rpx"
        ></image>
      </view>
      <view class="" style="font-size: 30rpx; text-align: center">
        {{ data.drugs_status == 1 ? '医生开药中' : '开药成功' }}
      </view>
      <view class="" style="font-size: 26rpx; text-align: center; color: #666666; padding-top: 34rpx" v-if="data.drugs_status == 1">已收到您的开药申请，请耐心等待</view>
      <view class="" style="font-size: 26rpx; text-align: center; color: #666666; padding: 10rpx 0 36rpx 0" v-if="data.drugs_status == 1">
        <text>如还需其他处方，请点此继续</text>
        <text style="color: #1a9eff; padding-left: 15rpx" @tap="kai">申请开药</text>
      </view>
      <view class="" style="font-size: 26rpx; text-align: center; color: #666666; padding: 34rpx" v-if="data.drugs_status == 2">
        开药成功 !
        <!-- <text style="color: #1A9EFF;padding-left: 15rpx;">点击查看</text> -->
      </view>
    </view>
    <!-- 单子 -->
    <view class="" style="margin: 0 28rpx; background: #fff; border-radius: 20rpx">
      <view class="" style="font-size: 30rpx; padding: 36rpx 38rpx">{{ data.patient_name }}（{{ data.patient_gender == 0 ? '女' : '男' }} {{ data.patient_age }}岁）</view>
      <view class="" style="font-size: 28rpx; display: flex; align-items: center; padding: 0 36rpx">
        <view class="" style="color: #666666">所在地区</view>
        <view class="" style="padding-left: 57rpx">
          {{ data.patient_city }}
        </view>
      </view>
      <view class="" style="font-size: 28rpx; display: flex; align-items: center; padding: 19rpx 36rpx">
        <view class="" style="color: #666666">联系电话</view>
        <view class="" style="padding-left: 57rpx">
          {{ data.patient_mobile }}
        </view>
      </view>
      <view class="" style="font-size: 28rpx; display: flex; padding: 19rpx 36rpx; align-items: flex-start">
        <view class="" style="color: #666666">病情描述</view>
        <view class="" style="padding-left: 57rpx; padding-right: 55rpx; width: 400rpx">
          {{ data.illness_one }}
        </view>
      </view>
      <view class="" style="font-size: 28rpx; display: flex; align-items: flex-start; padding: 19rpx 36rpx">
        <view class="" style="color: #666666">上传处方</view>
        <view class="" style="padding-left: 57rpx; display: flex; align-items: center">
          <image :src="img_url + i" mode="aspectFill" style="width: 162rpx; height: 160rpx; border-radius: 12rpx" v-for="(i, k) in data.illness_image" :key="k"></image>
        </view>
      </view>

      <view class="" style="font-size: 28rpx; display: flex; align-items: flex-start; padding: 19rpx 36rpx">
        <view class="" style="color: #666666">补充说明</view>
        <view class="" style="padding-left: 57rpx">
          {{ data.illness_three }}
          <!-- <view class="">
					 	 	 过敏史：无
					 	 </view>
						 <view class="" style="padding-top: 20rpx;">
						 	既往病史：无
						 </view> -->
        </view>
      </view>

      <view class="" style="font-size: 28rpx; display: flex; align-items: flex-start; padding: 19rpx 36rpx">
        <view class="" style="color: #666666">提交时间</view>
        <view class="" style="padding-left: 57rpx">
          {{ data.submit_time_text }}
        </view>
      </view>

      <view class="" style="font-size: 28rpx; display: flex; align-items: flex-start; padding: 19rpx 36rpx" v-if="data.drgus_way == 1">
        <view class="" style="color: #666666">线下自提</view>
        <view class="" style="padding-left: 57rpx">
          {{ data.clinic_name }}
        </view>
      </view>

      <!-- <view class="" style="font-size: 28rpx;display: flex;align-items: flex-start;padding: 19rpx 36rpx;" v-if="data.drgus_way==2">
					 <view class="" style="color: #666666;">
					 	 邮寄地址
					 </view>
					 <view class="" style="padding-left: 57rpx;width: 400rpx;">
					 	{{data.t_address}}
					 </view>
				</view> -->
    </view>
    <!-- <view class="" style="font-size: 26rpx;color: #999999;text-align: center;padding-top: 27rpx;padding-bottom: 57rpx;">
		 	 客服电话：820-868686
		 </view> -->
  </view>
</template>

<script>
export default {
  name: '',
  data() {
    return {
      background: {
        background: '#F8F8F8'
      },
      id: null,
      data: {}
    };
  },
  //方法
  methods: {
    detail() {
      this.api({
        url: '/api//drugs/details',
        method: 'post',
        data: {
          id: this.id
        }
      }).then((res) => {
        this.data = res.data;
      });
    },
    kai() {
      uni.navigateTo({
        url: '/pages/news/press'
      });
    }
  },
  //首页渲染
  onLoad(op) {
    this.id = op.id;
    this.detail();
  },
  //监听
  watch: {},
  //计算属性
  computed: {}
};
</script>

<style lang="scss" scoped>
page {
  background: #f8f8f8;
}
</style>
